//首页，组件在Home文件下
import React from 'react'
import { Router, withRouter } from "react-router-dom";
import Position from './Home/Position'
import Choise from './Home/Choise'
import Mycarousel from './Home/Mycarousel'
import List from './Home/List';
import Mytab from './Mytab'
import { connect } from 'react-redux'
import 'antd-mobile/dist/antd-mobile.css'
import { getbuslist ,getsplist} from '../redux/actionCreator';

class Home extends React.Component {
    constructor(props) {
        super(props)
        this.props.dispatch(getbuslist())
        this.props.dispatch(getsplist())
        console.log(this.props.login[0])
    }
    render() {
        localStorage.setItem('business', JSON.stringify(this.props.business))
        return (
            // <Router></Router>
            <div style={{ minHeight: '100vh', display: 'flex' }}>
                <div style={{ backgroundColor: "#080904", minHeight: '100vh', display: 'flex', width: '100%' }}>
                    <Position />
                    <div style={{ width: '90%', margin: '0 auto' }}>
                        <Choise />
                        {/* <MyGrid/> */}
                        <Mycarousel />
                        <List />

                    </div>
                    <Mytab />
                </div>
                <div style={{ flex: '1' }}></div>
            </div >
        )
    }
}
const mapStateToProps = (state) => ({
    business: state.business,
    login:state.login
})

export default withRouter(connect(mapStateToProps)(Home))


// export default withRouter(Home)
